/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.service.impl;

import cc.altius.dao.CityDao;
import cc.altius.model.City;
import cc.altius.model.State;
import cc.altius.service.CityService;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author santosh
 */
@Service("CityService")
public class CityServiceImpl implements CityService {

    @Autowired
    private CityDao cityDao;

    @Override
    public List<State> getStateList() {
        return this.cityDao.getStateList();
    }

    @Override
    public Boolean addCity(City city) {
        return  this.cityDao.addCity(city);
    }

    @Override
    public List<City> getCityList() {
        return this.cityDao.getCityList();
    }

    @Override
    public int editCity(City city) {
        return this.cityDao.editCity(city);
    }

    @Override
    public City getCityById(int cityId) {
        return this.cityDao.getCityById(cityId);
    }

    @Override
    public List<Map<String, Object>> getFilterCity(int stateId) {
        return this.cityDao.getFilterCity(stateId);
    }

    @Override
    public boolean existCityByCityName(String cityName) {
        if(this.cityDao.getCityByCityName(cityName)==null){
        return false;
        }else{
        return true;
        }
    }
}
